package org.afei.ioc.data;


import java.util.Map;

/**
 * @author afei
 * @date 17-5-25.
 */
public class DefaultBeanDefinitionContext implements
        DataContext {

    private Map<String, Object> beanDefinitionMap = null;

    public DefaultBeanDefinitionContext() {
    }

    @Override
    public void initData(Map<String, Object> map) {
        beanDefinitionMap = map;
    }

    @Override
    public void set(String name, Object obj) {
        beanDefinitionMap.put(name, obj);
    }

    @Override
    public Object get(String name) {
        return beanDefinitionMap.get(name);
    }

    @Override
    public <T> T get(String name, Class<T> clazz) {
        return (T) beanDefinitionMap.get(name);
    }

    @Override
    public Map<String, Object> getAll() {
        return beanDefinitionMap;
    }

}
